Optimal. Leaf size=182 \[ -\frac {a^3 (45 A-47 i B) \tan ^3(c+d x)}{60 d}-\frac {(5 A-7 i B) \tan ^3(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{20 d}+\frac {2 a^3 (B+i A) \tan ^2(c+d x)}{d}+\frac {4 a^3 (A-i B) \tan (c+d x)}{d}+\frac {4 a^3 (B+i A) \log (\cos (c+d x))}{d}-4 a^3 x (A-i B)+\frac {i a B \tan ^3(c+d x) (a+i a \tan (c+d x))^2}{5 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.42, antiderivative size = 182, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.147, Rules used = {3594, 3592, 3528, 3525, 3475} \[ -\frac {a^3 (45 A-47 i B) \tan ^3(c+d x)}{60 d}+\frac {2 a^3 (B+i A) \tan ^2(c+d x)}{d}-\frac {(5 A-7 i B) \tan ^3(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{20 d}+\frac {4 a^3 (A-i B) \tan (c+d x)}{d}+\frac {4 a^3 (B+i A) \log (\cos (c+d x))}{d}-4 a^3 x (A-i B)+\frac {i a B \tan ^3(c+d x) (a+i a \tan (c+d x))^2}{5 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3525
Rule 3528
Rule 3592
Rule 3594
Rubi steps
\begin {align*} \int \tan ^2(c+d x) (a+i a \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx &=\frac {i a B \tan ^3(c+d x) (a+i a \tan (c+d x))^2}{5 d}+\frac {1}{5} \int \tan ^2(c+d x) (a+i a \tan (c+d x))^2 (a (5 A-3 i B)+a (5 i A+7 B) \tan (c+d x)) \, dx\\ &=\frac {i a B \tan ^3(c+d x) (a+i a \tan (c+d x))^2}{5 d}-\frac {(5 A-7 i B) \tan ^3(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{20 d}+\frac {1}{20} \int \tan ^2(c+d x) (a+i a \tan (c+d x)) \left (a^2 (35 A-33 i B)+a^2 (45 i A+47 B) \tan (c+d x)\right ) \, dx\\ &=-\frac {a^3 (45 A-47 i B) \tan ^3(c+d x)}{60 d}+\frac {i a B \tan ^3(c+d x) (a+i a \tan (c+d x))^2}{5 d}-\frac {(5 A-7 i B) \tan ^3(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{20 d}+\frac {1}{20} \int \tan ^2(c+d x) \left (80 a^3 (A-i B)+80 a^3 (i A+B) \tan (c+d x)\right ) \, dx\\ &=\frac {2 a^3 (i A+B) \tan ^2(c+d x)}{d}-\frac {a^3 (45 A-47 i B) \tan ^3(c+d x)}{60 d}+\frac {i a B \tan ^3(c+d x) (a+i a \tan (c+d x))^2}{5 d}-\frac {(5 A-7 i B) \tan ^3(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{20 d}+\frac {1}{20} \int \tan (c+d x) \left (-80 a^3 (i A+B)+80 a^3 (A-i B) \tan (c+d x)\right ) \, dx\\ &=-4 a^3 (A-i B) x+\frac {4 a^3 (A-i B) \tan (c+d x)}{d}+\frac {2 a^3 (i A+B) \tan ^2(c+d x)}{d}-\frac {a^3 (45 A-47 i B) \tan ^3(c+d x)}{60 d}+\frac {i a B \tan ^3(c+d x) (a+i a \tan (c+d x))^2}{5 d}-\frac {(5 A-7 i B) \tan ^3(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{20 d}-\left (4 a^3 (i A+B)\right ) \int \tan (c+d x) \, dx\\ &=-4 a^3 (A-i B) x+\frac {4 a^3 (i A+B) \log (\cos (c+d x))}{d}+\frac {4 a^3 (A-i B) \tan (c+d x)}{d}+\frac {2 a^3 (i A+B) \tan ^2(c+d x)}{d}-\frac {a^3 (45 A-47 i B) \tan ^3(c+d x)}{60 d}+\frac {i a B \tan ^3(c+d x) (a+i a \tan (c+d x))^2}{5 d}-\frac {(5 A-7 i B) \tan ^3(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{20 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 8.60, size = 847, normalized size = 4.65 \[ \frac {x \left (-2 A \cos ^3(c)+2 i B \cos ^3(c)+8 i A \sin (c) \cos ^2(c)+8 B \sin (c) \cos ^2(c)+12 A \sin ^2(c) \cos (c)-12 i B \sin ^2(c) \cos (c)+2 A \cos (c)-2 i B \cos (c)-8 i A \sin ^3(c)-8 B \sin ^3(c)-4 i A \sin (c)-4 B \sin (c)-2 A \sin ^3(c) \tan (c)+2 i B \sin ^3(c) \tan (c)-2 A \sin (c) \tan (c)+2 i B \sin (c) \tan (c)-i (A-i B) (4 \cos (3 c)-4 i \sin (3 c)) \tan (c)\right ) (i \tan (c+d x) a+a)^3 (A+B \tan (c+d x)) \cos ^4(c+d x)}{(\cos (d x)+i \sin (d x))^3 (A \cos (c+d x)+B \sin (c+d x))}+\frac {\left (i A \cos \left (\frac {3 c}{2}\right )+B \cos \left (\frac {3 c}{2}\right )+A \sin \left (\frac {3 c}{2}\right )-i B \sin \left (\frac {3 c}{2}\right )\right ) \left (2 \cos \left (\frac {3 c}{2}\right ) \log \left (\cos ^2(c+d x)\right )-2 i \log \left (\cos ^2(c+d x)\right ) \sin \left (\frac {3 c}{2}\right )\right ) (i \tan (c+d x) a+a)^3 (A+B \tan (c+d x)) \cos ^4(c+d x)}{d (\cos (d x)+i \sin (d x))^3 (A \cos (c+d x)+B \sin (c+d x))}+\frac {\sec (c) \sec (c+d x) \left (\frac {1}{240} \cos (3 c)-\frac {1}{240} i \sin (3 c)\right ) (195 i A \cos (d x)+225 B \cos (d x)-300 A d x \cos (d x)+300 i B d x \cos (d x)+195 i A \cos (2 c+d x)+225 B \cos (2 c+d x)-300 A d x \cos (2 c+d x)+300 i B d x \cos (2 c+d x)+75 i A \cos (2 c+3 d x)+105 B \cos (2 c+3 d x)-150 A d x \cos (2 c+3 d x)+150 i B d x \cos (2 c+3 d x)+75 i A \cos (4 c+3 d x)+105 B \cos (4 c+3 d x)-150 A d x \cos (4 c+3 d x)+150 i B d x \cos (4 c+3 d x)-30 A d x \cos (4 c+5 d x)+30 i B d x \cos (4 c+5 d x)-30 A d x \cos (6 c+5 d x)+30 i B d x \cos (6 c+5 d x)+420 A \sin (d x)-470 i B \sin (d x)-330 A \sin (2 c+d x)+360 i B \sin (2 c+d x)+270 A \sin (2 c+3 d x)-280 i B \sin (2 c+3 d x)-105 A \sin (4 c+3 d x)+135 i B \sin (4 c+3 d x)+75 A \sin (4 c+5 d x)-83 i B \sin (4 c+5 d x)) (i \tan (c+d x) a+a)^3 (A+B \tan (c+d x))}{d (\cos (d x)+i \sin (d x))^3 (A \cos (c+d x)+B \sin (c+d x))} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.66, size = 282, normalized size = 1.55 \[ \frac {{\left (360 i \, A + 480 \, B\right )} a^{3} e^{\left (8 i \, d x + 8 i \, c\right )} + {\left (1050 i \, A + 1170 \, B\right )} a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} + {\left (1230 i \, A + 1390 \, B\right )} a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + {\left (690 i \, A + 770 \, B\right )} a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (150 i \, A + 166 \, B\right )} a^{3} + {\left ({\left (60 i \, A + 60 \, B\right )} a^{3} e^{\left (10 i \, d x + 10 i \, c\right )} + {\left (300 i \, A + 300 \, B\right )} a^{3} e^{\left (8 i \, d x + 8 i \, c\right )} + {\left (600 i \, A + 600 \, B\right )} a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} + {\left (600 i \, A + 600 \, B\right )} a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + {\left (300 i \, A + 300 \, B\right )} a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (60 i \, A + 60 \, B\right )} a^{3}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}{15 \, {\left (d e^{\left (10 i \, d x + 10 i \, c\right )} + 5 \, d e^{\left (8 i \, d x + 8 i \, c\right )} + 10 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 10 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 5 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 1.01, size = 504, normalized size = 2.77 \[ \frac {60 i \, A a^{3} e^{\left (10 i \, d x + 10 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 60 \, B a^{3} e^{\left (10 i \, d x + 10 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 300 i \, A a^{3} e^{\left (8 i \, d x + 8 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 300 \, B a^{3} e^{\left (8 i \, d x + 8 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 600 i \, A a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 600 \, B a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 600 i \, A a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 600 \, B a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 300 i \, A a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 300 \, B a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 360 i \, A a^{3} e^{\left (8 i \, d x + 8 i \, c\right )} + 480 \, B a^{3} e^{\left (8 i \, d x + 8 i \, c\right )} + 1050 i \, A a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} + 1170 \, B a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} + 1230 i \, A a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 1390 \, B a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 690 i \, A a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + 770 \, B a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + 60 i \, A a^{3} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 60 \, B a^{3} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 150 i \, A a^{3} + 166 \, B a^{3}}{15 \, {\left (d e^{\left (10 i \, d x + 10 i \, c\right )} + 5 \, d e^{\left (8 i \, d x + 8 i \, c\right )} + 10 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 10 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 5 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.02, size = 230, normalized size = 1.26 \[ -\frac {i a^{3} B \left (\tan ^{5}\left (d x +c \right )\right )}{5 d}-\frac {i a^{3} A \left (\tan ^{4}\left (d x +c \right )\right )}{4 d}+\frac {4 i a^{3} B \left (\tan ^{3}\left (d x +c \right )\right )}{3 d}-\frac {3 a^{3} B \left (\tan ^{4}\left (d x +c \right )\right )}{4 d}+\frac {2 i a^{3} A \left (\tan ^{2}\left (d x +c \right )\right )}{d}-\frac {a^{3} A \left (\tan ^{3}\left (d x +c \right )\right )}{d}-\frac {4 i a^{3} B \tan \left (d x +c \right )}{d}+\frac {2 a^{3} B \left (\tan ^{2}\left (d x +c \right )\right )}{d}+\frac {4 A \,a^{3} \tan \left (d x +c \right )}{d}-\frac {2 i a^{3} A \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{d}-\frac {2 a^{3} B \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{d}+\frac {4 i a^{3} B \arctan \left (\tan \left (d x +c \right )\right )}{d}-\frac {4 a^{3} A \arctan \left (\tan \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.87, size = 134, normalized size = 0.74 \[ -\frac {12 i \, B a^{3} \tan \left (d x + c\right )^{5} - {\left (-15 i \, A - 45 \, B\right )} a^{3} \tan \left (d x + c\right )^{4} + 20 \, {\left (3 \, A - 4 i \, B\right )} a^{3} \tan \left (d x + c\right )^{3} - {\left (120 i \, A + 120 \, B\right )} a^{3} \tan \left (d x + c\right )^{2} + 240 \, {\left (d x + c\right )} {\left (A - i \, B\right )} a^{3} - 60 \, {\left (-2 i \, A - 2 \, B\right )} a^{3} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 240 \, {\left (A - i \, B\right )} a^{3} \tan \left (d x + c\right )}{60 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 6.15, size = 230, normalized size = 1.26 \[ \frac {{\mathrm {tan}\left (c+d\,x\right )}^3\,\left (\frac {B\,a^3\,1{}\mathrm {i}}{3}-\frac {a^3\,\left (2\,A-B\,1{}\mathrm {i}\right )}{3}+\frac {a^3\,\left (2\,B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{3}\right )}{d}+\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (A\,a^3-B\,a^3\,1{}\mathrm {i}+a^3\,\left (2\,A-B\,1{}\mathrm {i}\right )-a^3\,\left (2\,B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}\right )}{d}-\frac {{\mathrm {tan}\left (c+d\,x\right )}^4\,\left (\frac {B\,a^3}{4}+\frac {a^3\,\left (2\,B+A\,1{}\mathrm {i}\right )}{4}\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (4\,B\,a^3+A\,a^3\,4{}\mathrm {i}\right )}{d}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (\frac {A\,a^3\,1{}\mathrm {i}}{2}+\frac {B\,a^3}{2}+\frac {a^3\,\left (2\,A-B\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2}+\frac {a^3\,\left (2\,B+A\,1{}\mathrm {i}\right )}{2}\right )}{d}-\frac {B\,a^3\,{\mathrm {tan}\left (c+d\,x\right )}^5\,1{}\mathrm {i}}{5\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 1.16, size = 303, normalized size = 1.66 \[ \frac {4 i a^{3} \left (A - i B\right ) \log {\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} + \frac {- 150 A a^{3} + 166 i B a^{3} + \left (- 690 A a^{3} e^{2 i c} + 770 i B a^{3} e^{2 i c}\right ) e^{2 i d x} + \left (- 1230 A a^{3} e^{4 i c} + 1390 i B a^{3} e^{4 i c}\right ) e^{4 i d x} + \left (- 1050 A a^{3} e^{6 i c} + 1170 i B a^{3} e^{6 i c}\right ) e^{6 i d x} + \left (- 360 A a^{3} e^{8 i c} + 480 i B a^{3} e^{8 i c}\right ) e^{8 i d x}}{15 i d e^{10 i c} e^{10 i d x} + 75 i d e^{8 i c} e^{8 i d x} + 150 i d e^{6 i c} e^{6 i d x} + 150 i d e^{4 i c} e^{4 i d x} + 75 i d e^{2 i c} e^{2 i d x} + 15 i d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________